package com.hp.bon.sgw.wh.channel.groupConsistency;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import com.hp.bon.sgw.wh.channel.common.BizConsts;

public class ConsistencyApiUrls {

	private static final Map<String, String> capabilities = new HashMap<String, String>();
	static {
		capabilities.put("QryReturnBalanceDetail", BizConsts.TYPE_API_CAPABILITY_HTTP);	
		capabilities.put("QryReturnBalanceInfoDetail", BizConsts.TYPE_API_CAPABILITY_HTTP);		
		capabilities.put("QryBalanceRecord", BizConsts.TYPE_API_CAPABILITY_HTTP);		
		capabilities.put("QryBalanceRecordDetail", BizConsts.TYPE_API_CAPABILITY_HTTP);		
		capabilities.put("QueryBalance", BizConsts.TYPE_API_CAPABILITY_HTTP);
		capabilities.put("QryPayment", BizConsts.TYPE_API_CAPABILITY_HTTP);		
		capabilities.put("QryBill", BizConsts.TYPE_API_CAPABILITY_HTTP);		
		capabilities.put("AccuUseQry", BizConsts.TYPE_API_CAPABILITY_HTTP);
		capabilities.put("AccuUseDetailQry", BizConsts.TYPE_API_CAPABILITY_HTTP);
		capabilities.put("QryCustBill", BizConsts.TYPE_API_CAPABILITY_HTTP);
		capabilities.put("QryInstantFeeList", BizConsts.TYPE_API_CAPABILITY_HTTP);
		capabilities.put("CreditProdFee", BizConsts.TYPE_API_CAPABILITY_HTTP);
	}
	
	public static Set<String> listApiUrls() {
		return Collections.unmodifiableSet(capabilities.keySet());
	}
	
	public static boolean hasApiUris(String capability) {
		return capabilities.containsKey(capability);
	}
	
	public static boolean isWSCapability(String capability) {
		if(BizConsts.TYPE_API_CAPABILITY_WS.endsWith(capabilities.get(capability))) {
			return true;
		}
		return false;
	}
	
	public static boolean isHttpCapability(String capability) {
		if(BizConsts.TYPE_API_CAPABILITY_HTTP.endsWith(capabilities.get(capability))) {
			return true;
		}
		return false;
	}
}
